<%@page import="com.xxb.entity.Product"%>
<%@page import="com.xxb.dao.ProductDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String id = request.getParameter("id");
	
	ProductDao dao = new ProductDao();
	Product product = dao.findByid(Integer.valueOf(id));
	if(product == null) {
		response.sendRedirect("l_productlist.jsp?code=101");
	} else {
		int rows = dao.delete(product.getId());
		if(rows > 0) {
			response.sendRedirect("l_productlist.jsp?code=100");
		}
	}
%>